@extends('admin.layouts.head')
@section('content')
    <body>
    <div id="app">
        <div class="wrapper -header-fixed">

        @include('admin.layouts.navbar')
        @include('admin.layouts.sidebar')

        <!-- 内容页开始-->
            <div class="content-container">
                <div class="container-fluid">
                    <div class="page-content">

                        <nav aria-label="breadcrumb">
                            <ol class="breadcrumb">
                                <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">仪表盘</a></li>
                                <li class="breadcrumb-item active" aria-current="page">充值平台</li>
                            </ol>
                        </nav>

                        <div class="card">
                            <div class="card-body">

                                <div class="form-group">
                                    <div class="row">
                                        <div class="col-lg-10 col-md-7" style="margin-bottom: 10px">
                                            <a href="{{route('admin.payPlat.edit', 0)}}" class="btn btn-primary"> 添加 </a>
                                        </div>
                                    </div>
                                </div>

                                <div class="table-responsive">
                                    <table class="table table-sm table-hover text-center">
                                        <thead>
                                        <tr>
                                            <th style="min-width:50px;">ID</th>
                                            <th style="min-width:135px;">名称</th>
                                            <th style="min-width:135px;">app_key</th>
                                            <th style="min-width:50px;">game_id</th>
                                            <th style="min-width:160px;">group_id</th>
                                            <th style="min-width:110px;">type_id</th>
                                            <th style="min-width:110px;">user_id</th>
                                            <th style="min-width:110px;">pay_version</th>
                                            <th style="min-width:110px;">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($list as $item)
                                            <tr>
                                                <td>{{$item->id}}</td>
                                                <td>{{$item->plat_name}}</td>
                                                <td>{{$item->app_key}}</td>
                                                <td>{{$item->game_id}}</td>
                                                <td>{{$item->group_id}}</td>
                                                <td>{{$item->type_id}}</td>
                                                <td>{{$item->user_id}}</td>
                                                <td>{{$item->pay_version}}</td>
                                                <td>
                                                    <a href="{{ route('admin.payPlat.edit',$item->id) }}" class="btn btn-primary btn-sm">修改</a>
                                                    <a href="javascript:void(0);" class="btn btn-danger btn-sm" onclick="operation_tip2({{$item->id}})">删除</a>
                                                </td>
                                            </tr>
                                        @endforeach
                                        </tbody>
                                    </table>
                                </div>

                            </div> <!-- .card-body -->

                        </div> <!-- .card -->

                    </div> <!-- .page-content -->
                </div> <!-- .container-fluid -->
            </div> <!-- .content-container -->
        </div> <!-- .wrapper -->
    </div> <!-- #app -->
    <script src="{{ mix('js/app.js') }}"></script>
    <script src="{{ asset('/js/main.js') }}"></script>
    <script>
        //删除
        function submit(id) {
            var isLoading = false;
            if (isLoading === false) {
                isLoading = true;

                axios.delete('{{route('admin.payPlat.destroy','').'/'}}'+id)
                    .then(function (response) {
                        isLoading = false;
                        toast_tip2(response.data.message, window.location.href);
                    })
                    .catch(function (error) {
                        isLoading = false;
                        $.each(error.response.data.errors, function (index, object) {
                            toast(object[0]);
                            return false;
                        });
                    })
            }

        }
    </script>
    </body>

@endsection
